{% if data %}
    <table id="{{ active_page }}" class="table table-sm text-start align-middle w-100">
        <thead>
        <tr>
            <th scope="col" data-priority="-1">File Name</th>
            <th scope="col">Extension</th>
            <th scope="col">Date</th>
            {% if config.add_complete_column and active_page == 'failed' %}
                <th scope="col">Completed</th>
            {% endif %}
            <th scope="col">Size</th>
            {% if config.add_columns_from_log and config.write_namer_failed_log and active_page == 'failed' %}
                <th scope="col">Percentage</th>
                <th scope="col">PHash</th>
                <th scope="col">OSHash</th>
            {% endif %}
            {% if active_page == 'failed' %}
                <th scope="col" data-orderable="false" data-priority="-2" class="noVis"></th>
            {% endif %}
        </tr>
        </thead>
        <tbody>
        {% for file in data %}
            <tr>
                <td class="col text-break">{{ file['name'] }}</td>
                <td class="col-1">{{ file['ext'] }}</td>
                <td class="col-2" data-order="{{ file['update_time'] }}">{{ file['update_time']|timestamp_to_datetime|strftime('%d-%m-%Y %H:%M:%S') }}</td>
                {% if config.add_complete_column and active_page == 'failed' %}
                    <td class="col-2" data-order="{{ file['log_time'] }}">{{ file['log_time']|timestamp_to_datetime|strftime('%d-%m-%Y %H:%M:%S') }}</td>
                {% endif %}
                <td class="col-1" data-order="{{ file['size'] }}">{{ file['size']|filesizeformat(binary=True) }}</td>
                {% if config.add_columns_from_log and config.write_namer_failed_log and active_page == 'failed' %}
                    <td class="col-1" data-order="{{ file['percentage'] }}">{{ '%.1f'|format(file['percentage']) }}%</td>
                    <td class="col-1" data-order="{{ file['phash'] }}">{{ file['phash'] }}</td>
                    <td class="col-1" data-order="{{ file['oshash'] }}">{{ file['oshash'] }}</td>
                {% endif %}
                {% if active_page == 'failed' %}
                    <td class="col-2 text-end">
                        {% include 'render/fileActions.html' %}
                    </td>
                {% endif %}
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <div class="col m-1 text-center">
        <span>No files found</span>
    </div>
{% endif %}
